<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件流</title>
    <style>
        .big {
            width: 300px;
            height: 300px;
            background-color: red;
        }

        .middle {
            width: 200px;
            height: 200px;
            margin-left: 300px;
            background-color: blue;
        }

        .small {
            width: 100px;
            height: 100px;
            margin-left: 200px;
            background-color: green;
        }
    </style>
</head>

<body>
    <div class="big">
        <div class="middle">
            <div class="small">
            </div>
        </div>
    </div>
    <script>
        let big = document.querySelector(".big");
        let middle = document.querySelector(".middle");
        let small = document.querySelector(".small");
        big.onclick = (e) => {
            alert("big");
        }
        middle.onclick = (e) => {
            alert("middle");
        }
        small.onclick = (e) => {
            alert("small");
            // e.stopPropagation();
        }
        big.addEventListener("click",()=>{
            alert("big2")
        },true);
        middle.addEventListener("click",()=>{
            alert("middle2")
        },true);
        small.addEventListener("click",()=>{
            alert("small2")
        },true);
    </script>
</body>

</html>